Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: fix seo-tap-targets in high DPI #14866

Merged
merged 1 commit into from
Mar 13, 2023
Merged

Conversation

paulirish
Copy link
Member

fixes #13557

The failure was
image

The case was these two elements: (zero width target and passing target)
image

In taptargets we take each target (eg zero width target) as a rect. then we place a hypothetical 48x48 finger at the center of the rect. Then we see how many pixels of overlap it has with the adjacent target (passing target)

Test said it should be 720 pixels of overlap area, but on a high dpi screen it was 696. They're both right.

In hidpi you can have fractional CSS pixels.. so.. a lot of things are 18.5px tall. And that ends up with a very similar but slightly off result in these rect overlap calculations.

Fixing it with a font-size on the body was a guess. I never understood this whole thing but it probably is related.


The discrepancy above points to a problem with the implementation of emulation. I can repro this difference while emulating DPR=2 on my dpi1 screen and emulating DPR=2 on my dpi2 screen. One says 18px tall, the other 18.5px tall. Thats not supposed to happen. That said, this subtlety probably isn't causing us large problems, so I'm not concerned.

@paulirish paulirish requested a review from a team as a code owner March 7, 2023 22:53
@paulirish paulirish requested review from connorjclark and removed request for a team March 7, 2023 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix dbw/tap-targets smoke tests on high DPI machines
4 participants